using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SleepGrass : MonoBehaviour
{

    public Collider2D coll;

    void OnEnable(){
        EventHandler_Prop.SleepGrassFollowEvent += OnSleepGrassFollowEvent;
    }

    void OnSleepGrassFollowEvent(GameObject obj, Rigidbody2D rb){
        if(obj == this.gameObject){
            rb.isKinematic = true;
            coll.isTrigger = true;
        }
    }

    void OnDisable(){
        EventHandler_Prop.SleepGrassFollowEvent -= OnSleepGrassFollowEvent;
    }
}
